package test1.practice;

public class practice2 {
    public static void main(String[] args) {
        int []arr={1,2,3,4,5,6,7,8,9,};
        int[]copyARR=copyOFRange(arr,3,7);
        for (int i = 0; i < copyARR.length; i++) {
            System.out.print(copyARR[i]+" ");
        }
    }
public static int[]copyOFRange(int[]arr,int from,int to){
        int[] newARR=new int[to-from];
        int index=0;
    for (int i = from; i < to; i++) {
        newARR[index]=arr[i];
        index++;
    }
    return newARR;
}
}
